package service.impl;

import common.consts.Commons;
import dao.RecruitmentGroupDao;
import domain.RecruitmentGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.RecruitmentGroupService;
import service.ServiceResponse;

import java.util.List;

/**
 * Created by aceyin on 15/7/7.
 */
@Service
public class RecruitmentGroupServiceImpl extends ServiceBase implements RecruitmentGroupService {
    @Autowired
    private RecruitmentGroupDao recruitmentGroupDao;

    @Override
    public ServiceResponse getValidGroups() {
        List<RecruitmentGroup> list = recruitmentGroupDao.findByStatus(Commons.Status.NORMAL.name());
        return ServiceResponse.success().with("groups", list);
    }
}
